<%@ page language="java"
	import="java.util.*,edu.cnu.tpts.bean.*,edu.cnu.tpts.dao.*,edu.cnu.tpts.dao.impl.*"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/authorize.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'showScore.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
	
		<table>
				<tr>
				<td>
					课程名称
				</td>
				<td>
					作业情况
				</td>
					<td>
					平时测验
				</td>
					<td>
					总成绩
				</td>
				
			</tr>
		
		<%
			Student stu = (Student) session.getAttribute("user");

			StudentDao stuDao = new StudentDaoImpl();
			List<StudentScore> scorelist = stuDao.findScores(stu.getId());
			//System.out.println(scorelist.size());
			for (int i = 0; i < scorelist.size(); i++) {
				StudentScore score = scorelist.get(i);
				String couresName = score.getCourseName();
				int taskScore = score.getTaskScore();
				int testScore = score.getTestScore();
				int totalScore = score.getTotalScore();
		%>
	
	
			<tr>
				<td><%=couresName%></td>
				<td><%=taskScore%></td>
				<td><%= testScore%></td>
				<td><%=totalScore%></td>
			</tr>




		<%
			}
		%>
				
		</table>
		
	</body>
</html>
